package cn.gson.springboot.model.dao.presaledao;

import cn.gson.springboot.model.pjos.Programme;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

public interface ProgrammeDao extends CrudRepository<Programme, Integer> {
//    客户合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update programme set custom_id = ?1 where custom_id = ?2")
    public void upCustomer(Integer daoId,Integer congId);

    /**
     * 查询方案信息
     * @param programmeId
     * @return
     */
    @Query(value = "select * from programme where programme_id=?1", nativeQuery = true)
    Programme searchProgramme(Integer programmeId);
}
